/**
 * Project Name:szpay
 * File Name:MyFormAuthenticationFilter.java
 * Package Name:com.sz.core.sys.form
 * Date:2015年9月24日下午12:31:27
 *	用于验证码验证的Shiro 拦截器在用于身份认证的拦截器之前运行；但是如果验证码验证
	拦截器失败了，就不需要进行身份认证拦截器流程了；所以需要修改下如
	FormAuthenticationFilter身份认证拦截器，当验证码验证失败时不再走身份认证拦截器,
	即如果之前已经错了，那直接跳过即可
 */

package com.energy.analysis.sys.shiro.form;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
 
public class MyFormAuthenticationFilter extends FormAuthenticationFilter {
	 @Override
	 protected boolean onAccessDenied(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
			if (request.getAttribute(getFailureKeyAttribute()) != null) {
				return true;
			}
			return super.onAccessDenied(request, response, mappedValue);
	}
	 
}
